package com.csx.micrometer.invoke.util;

import com.csx.micrometer.invoke.constant.HttpStatusConstant;

/**
 * @author cuisongxu
 * @date 2022/12/6 16:36
 */
public class HttpStatusUtil {

    /**
     * 根据状态码判断http请求是否成功
     * @param code 状态码
     * @return
     */
    public static boolean isSuccess(int code) {
        if(code >= HttpStatusConstant.SUCCESS && code < HttpStatusConstant.ERROR) {
            return true;
        }
        return false;
    }
}
